package com.ruoyi.mall.app.controller;


import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.mall.app.service.DtsAdService;
import com.ruoyi.mall.common.domain.DtsAd;
import com.ruoyi.mall.common.domain.DtsAddress;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


import java.util.List;

@RestController
@RequestMapping("/api/index/ad")
public class DtsAdController extends BaseController {

    @Autowired
    private DtsAdService dtsAdService;

    // 广告
    @GetMapping("/adList")
    public AjaxResult adList()
    {
        List<DtsAd> list = dtsAdService.selectAll();
        if (list != null){
            return success(list);
        }else {
            return error();
        }
    }
}
